package cn.tedu.socket;

import java.io.*;
import java.net.Socket;

public class Client {
    public static void main(String[] args) throws Exception {
        //1.构建Socket对象与服务器建立连接
        Socket socket = new Socket("localhost", 8888);
        OutputStream out = socket.getOutputStream();
        OutputStreamWriter osw = new OutputStreamWriter(out);
        BufferedWriter bufferedWriter = new BufferedWriter(osw);
        PrintWriter pw = new PrintWriter(bufferedWriter,true);
        pw.println("Hello");
        //Thread.sleep(20000);
        pw.println("Hello");
        pw.close();
    }
}
